
let _instance

class DataManager {

	constructor(){
		
	}
	
	static getInstance() {
		_instance = _instance || new this()
		return _instance
	}
	
	setValue(key,value){
		if(!key) throw Error('设置全局变量请输入键名') 
		getApp().globalData[key] = value
	}
	
	getValue(key){
		return getApp().globalData[key]
	}
}

export default DataManager.getInstance()